From: Alessandro Bono Date: Mon, 19 Aug 2024 16:02:04 +0000 (+0200) Subject: loginDialog: Get username directly from the conflicting session X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~219^2^2~37 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=647747fbd6afef2f9f939682ab6527f3877ffbfb;p=gnome-shell.git loginDialog: Get username directly from the conflicting session The conflicting session is owned by the same user per definition. Use the Name property of the conflicting session to get the username instead of assuming that `this._user` is defined and passing the username around. Part-of: --- diff --git a/data/dbus-interfaces/org.freedesktop.login1.Session.xml b/data/dbus-interfaces/org.freedesktop.login1.Session.xml index 5ebf2edf8..68c7d1162 100644 --- a/data/dbus-interfaces/org.freedesktop.login1.Session.xml +++ b/data/dbus-interfaces/org.freedesktop.login1.Session.xml @@ -5,6 +5,7 @@ + diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index db83f4621..9e1c050f8 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -414,9 +414,10 @@ export const ConflictingSessionDialog = GObject.registerClass({ 'force-stop': {}, }, }, class ConflictingSessionDialog extends ModalDialog.ModalDialog { - _init(conflictingSession, greeterSession, userName) { + _init(conflictingSession, greeterSession) { super._init(); + const userName = conflictingSession.Name; let bannerText; if (greeterSession.Remote && conflictingSession.Remote) /* Translators: is running for */ @@ -1091,8 +1092,7 @@ export const LoginDialog = GObject.registerClass({ _showConflictingSessionDialog(serviceName, conflictingSession) { let conflictingSessionDialog = new ConflictingSessionDialog(conflictingSession, - this._greeterSessionProxy, - this._user.get_user_name()); + this._greeterSessionProxy); conflictingSessionDialog.connect('cancel', () => { this._authPrompt.reset();